<?php
  
 // global $cmsData;
 // print_r($cmsData);
 
 
 //print_r(config::$userData);
  
    $sql       ="SELECT * FROM content WHERE menu_active = 1 AND _usergroup<=".config::$userData['usergroup_number']."
            AND ((item_parent_id = '".config::$contentData['content_id']."') OR 
             (item_parent_id <> '".config::$contentData['content_id']."' AND      
             item_parent_id = '".config::$contentData['item_parent_id']."') AND level=2) ORDER BY item_order";    
            
            
            //item_parent_id <> '".config::$contentData['content_id']."' AND
            
            
            
            /*OR 
            (item_parent_id <> '".config::$contentData['content_id']."' 
            AND item_parent_id = '".config::$contentData['item_parent_id']."')) ORDER BY item_order";    */
            
              
 //   echo $sql;                                                                                          
//$dataExternalSubMenu = new data();
//$dataExternalSubMenu->getQuery($sql);
 // do {
  
  foreach (db::getQuery($sql) as $externalSubmenu) {
  
?>
